<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>年级信息</title>
    <style type="text/css">
        .g{
            background-color: gray;
        }
    </style>
</head>
<body>
<ul style="list-style:none;">
<%--<%--%>
    <%--// List<Grade> list=(List<Grade>)request.getAttribute("grades");--%>
    <%--///int total=(Integer)request.getAttribute("total");--%>
    <%--//int pageNo=(Integer)request.getAttribute("pageNo");--%>
    <%--Page2<Grade> g=(Page2<Grade>)request.getAttribute("grades");--%>
    <%--int pageNo=g.getPageNo();--%>
    <%--int  total=g.getTotalPage();--%>
    <%--for(Grade gr:g.getDatas()){--%>
<%--%>--%>
     <%--<li><%=gr.getId()%> <%=gr.getGname()%></li>--%>
<%--<%}%>--%>
    <c:forEach items="${grades.datas}" var="ss" varStatus="s">

        <li <c:if test="${s.index%2==0}">class="g"</c:if>>
            ${ss.id},
            ${ss.getGname()}
        </li>
    </c:forEach>

</ul>
<p>
    <a href="gradeServlet?pageNo=1">首页</a>
    <c:if test="${grades.pageNo>1}">
        <a href="gradeServlet?pageNo=${grades.pageNo-1}">上一页</a>
    </c:if>
    <c:if test="${grades.pageNo<grades.totalPage}">
    <a href="gradeServlet?pageNo=${grades.pageNo+1}">下一页</a>
    </c:if>
    <a href="gradeServlet?pageNo=${grades.totalPage}">最后一页</a>
</p>
<h1>1---100的数</h1>
<c:forEach begin="1" end="100" step="3" var="i">
    ${i},
</c:forEach>
</body>
</html>
